﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace MINERP.Monitor.UserControls
{
    public partial class UCJianTou : UserControl
    {
        public UCJianTou()
        {
            InitializeComponent();
            //DrawJianTou();
        }

        private void UCJianTou_Paint(object sender, PaintEventArgs e)
        {
            Pen p = new Pen(Color.Turquoise,20);//设置笔的粗细为,颜色为蓝色
            Graphics g = this.CreateGraphics();
            //画虚线
            p.DashStyle = DashStyle.Dot;//定义虚线的样式为点
            //g.DrawLine(p, 10, 10, 200, 10);
            ////自定义虚线
            //p.DashPattern = new float[] { 2, 1 };//设置短划线和空白部分的数组
            //g.DrawLine(p, 10, 20, 200, 20);
            ////画箭头,只对不封闭曲线有用
            p.DashStyle = DashStyle.Solid;//实线
            p.EndCap = LineCap.ArrowAnchor;//定义线尾的样式为箭头
            //g.DrawLine(p, 10, 30, 200, 30);
            g.DrawLine(p, 0, this.Height / 2, this.Width, this.Height / 2);
            g.Dispose();
            p.Dispose();
        }
    }
}
